Repository navigation
Conversation
On Android, a numbered list nested in a bulleted item drew "1." over the first letters of each item. A nested item's text indent summed the root list's narrow bullet column with a fixed marginLeft, while its marker was right-aligned to its own wider "99." column, so the number landed on the text. iOS already indents from the item's own column. Backport the Android hunks of upstream enriched-markdown #1015 (size the number column to the widest marker) and #1023 (nested items start their text from their own marker column) into the existing package patch. Upgrading to 1.2.0, which ships both, would also swap the md4c parser that our patch's autolink fixes and web WASM build depend on. test:android now also runs the backported ListRenderingTest and TaskListInteractionTest suites.
Confidence 5/5No open findings. The new patch is an exact backport of the Android hunks of upstream enriched-markdown #1015 and #1023. Applied to the pinned nightly, it compiles, and the backported Robolectric suites pass, including the repro for this bug. One thing to know before merging: on Android, bullets nested under a numbered item now sit much closer to their parent's text. That is upstream's intended layout and matches iOS, but it is a visible change on top of the overlap fix. SummaryBefore, on Android, a numbered list under a bullet drew each number on top of its item's first letter ("1A reused branch name…"). After, each nested item starts its text after its own marker column ("1. A reused branch name…"). This covers numbers under a bullet, tasks under a bullet and bullets under a number, in chat, file previews, plans and PRs. iOS and web are unchanged. Product changes
SizeThe size fits the problem. The change reuses the existing package patch and the upstream fix rather than writing its own layout logic, and the PR's reason for not upgrading to 1.2.0 holds: 1.2.0 swaps the md4c parser that this patch's autolink fixes and the web WASM build depend on. The new comment in
What could breakNo open findings. What I verifiedRun in this review, at e9ec40a:
Not verified in this review:
CI does not run the Gradle suites ( Reviews (1) · Last reviewed commit: e9ec40a · Reviewed by Paseo |
… layouts (#10499) * chore(app): vendor react-native-enriched-markdown with the Paseo patch applied Copy react-native-enriched-markdown@1.2.0-nightly-20261014-766fc0e67 (upstream software-mansion/enriched-markdown 766fc0e67) into packages/react-native-enriched-markdown, with patches/react-native-enriched-markdown+1.2.0-nightly-20261014-766fc0e67.patch applied. Nothing else changes in this commit; the package is not a workspace yet. Reproduce: npm pack react-native-enriched-markdown@1.2.0-nightly-20261014-766fc0e67 tar xzf react-native-enriched-markdown-*.tgz mkdir -p t/node_modules && mv package t/node_modules/react-native-enriched-markdown (cd t && git init -q && git apply ../patches/react-native-enriched-markdown+*.patch) diff -r t/node_modules/react-native-enriched-markdown packages/react-native-enriched-markdown The diff is empty. * chore(app): consume react-native-enriched-markdown from its workspace Make packages/react-native-enriched-markdown a private workspace and point the app at it, then remove the patch-package patch it replaces. - package.json: private, version follows the root like every workspace, only the postinstall script that downloads tree-sitter grammars. Upstream's devDependencies would install a second react-native, so they are gone. - The package keeps its name, so autolinking, the Gradle project :react-native-enriched-markdown, the CocoaPods spec and imports are unchanged. - Lockfile: drop the nested registry copy under packages/app/node_modules; npm links node_modules/react-native-enriched-markdown to the workspace. - Formatting, lint and knip skip the vendored code. CI routes changes to it through the app and browser suites. - The codegen test checks the vendored package's generated props. - docs/markdown-renderer.md describes the fork and how to edit it. * fix(app): keep numbered sub-list markers off their text on Android From #9964, moved from the package patch into the vendored package. On Android, a numbered list nested in a bulleted item drew "1." over the first letters of each item. A nested item's text indent summed the root list's narrow bullet column with a fixed marginLeft, while its marker was right-aligned to its own wider "99." column, so the number landed on the text. iOS already indents from the item's own column. Backport the Android hunks of upstream enriched-markdown #1015 (size the number column to the widest marker) and #1023 (nested items start their text from their own marker column). test:android now also runs the backported ListRenderingTest and TaskListInteractionTest suites. docs/markdown-renderer.md lists the fork's backports, this one and #924, which the removed postinstall comment used to track. The vendored tree equals the #9964 patch applied to the pristine package. * fix(app): keep Android assistant replies inside their turns From #10380, moved from the package patch into the vendored package. On Android, an assistant reply with blockquotes nested inside a list could overlap its "Worked for ..." footer and the next user message: the displayed text and the layout measurement applied spans in different orders, and the list-wide line height inflated the blockquote spacers when it ran after them. Use the same span order for Android Markdown measurement and display. Apply list line height before blockquote spacers so nested quotes keep their configured padding and the reply fits above the turn footer. test:android now also runs ListBlockquoteMeasurementTest. Applied on top of #9964; the two changes share only ListRenderer.kt, where #10380's import and line-height call sit beside #9964's marker width code. Every other file equals the #10380 patch applied to the pristine package. * chore(app): match the vendored Markdown web block renderer source to its build The package patch changed lib/module/web/renderers/BlockRenderers.js (the renderers.codeBlock override and the zoom-in cursor on images) but not src/web/renderers/BlockRenderers.tsx. The app runs lib, so behavior does not change. Port both changes into src so src stays the source of lib.
|
superseded by #10499 which is now merged to main. |
Linked issue
None. Reported from a phone screenshot of an agent reply.
Type of change
Reasoning
On Android, a numbered list inside a bulleted item drew each number on the first letter of its item, for example "1A reused branch name…" instead of "1. A reused branch name…". Agent replies use this shape often, such as a bullet that introduces numbered cases. Chat, file previews, plans and PRs were all affected.
The cause is in
react-native-enriched-markdown's Android list layout. A nested item's text indent was the root list's marker column (a 3dp bullet + 7dp gap) plus a fixedmarginLeft(20dp), which is 30dp. Its number was right-aligned to its own99.column, ending at about 41dp. iOS indents from the item's own column and was not affected.Upstream fixed this in enriched-markdown#1023, which builds on #1015. Both merged after our pinned nightly. This PR backports their Android hunks into our existing package patch.
Why not upgrade to 1.2.0, which ships both? 1.2.0 replaces the md4c parser. Our patch carries md4c autolink fixes and a recompiled web WASM parser. A 3-way merge of the patch onto 1.2.0 conflicted in 44 files. That upgrade is its own piece of work.
Goals
Non-goals
react-native-enriched-markdownto 1.2.0.100.+ markers clipping on iOS). iOS did not have this bug.scripts/ci-workflow.test.mjs).QA
Android emulator (API 35), dev client built from this branch with
sim app android, connected to a dev daemon. I opened a workspace Markdown file in Explorer → Files → Preview with:main): the numbered items under the bullet render as "1A reused branch…", "2A fresh workspace…", "3An open PR.", with each digit over the first letter. Same-type nests render correctly.Patch integrity: applying the new patch to the clean
1.2.0-nightly-20261014-766fc0e67package withpatch-package --error-on-failproduces exactly the intended tree.node --test scripts/postinstall-patches.test.mjs scripts/ci-workflow.test.mjs: 31 pass.Not run locally: the backported Robolectric suites
ListRenderingTest(it includesmixedNestsStartTheirTextFromTheirOwnMarkerColumn) andTaskListInteractionTest. They are now part ofnpm run test:android.Not tested: iOS and web, which have no code changes. The app builds their native and JS from untouched files.
Checklist
npm run typecheckpasses (no TypeScript changes)npm run lintpassesnpm run formatpasses